// npx http-sever ./web --port=8000
const execSync = require('child_process').execSync;
const path = require('path');
const config = {
    p: 9000,
    o: '/web',
    P: 'http://127.0.0.1:3030'
};

function start_server() {
    let cmd = "npx http-server";
    for (var key in config) {
        cmd += ` -${key}=${config[key]}`
    };

    let programe = execSync(cmd);

    if (!programe) {
        console.log('启动失败', programe)
    } else {
        console.log('启动成功')
    }
}

start_server();